<?php
require("class.phpmailer.php");
require("class.smtp.php");

if($submit){
 $mail = new PHPMailer();
 $mail->IsSMTP();                      // send via SMTP
 $mail->Host     = "mail.phutthugian.info"; // SMTP servers
 $mail->SMTPAuth = true;     // turn on SMTP authentication
 $mail->Username = "phutthugian@phutthugian.info";  // SMTP username
 $mail->Password = "hiallmember"; // SMTP password
 $mail->From     ="phutthugian@phutthugian.info";
 $mail->FromName = "Mailer";
 $mail->AddAddress($email,""); //$email là d?a ch? email mà b?n mu?n g?i
 $mail->AddReplyTo("phutthugian@phutthugian.info","Information");
 $mail->WordWrap = 50;                              // set word wrap
 $mail->IsHTML(true);                               // send as HTML

 $mail->Subject  =  $subject;
 $mail->Body     =  $message;
 $mail->AltBody  =  "";
 if(!$mail->Send())
 {
    echo "Message was not sent ";
    echo "Mailer Error: " . $mail->ErrorInfo;
    exit;
 }
}
?>
<form name="frmSend" action="sendmail.php" method="post">
To:<br>
<input name="email" type="text" value="" size="30"><br><br>
Subject:<br>
<input name="subject" type="text" value="" size="30"><br><br>
Messenger:<br>
<textarea name="message" rows=5 cols=40></textarea><br>
<input type="submit" name="submit" value="Send">
</form> 